package com.tianyiyan.hibernate.tyenword;

import java.util.HashSet;
import java.util.Set;

public class Word extends Vocabulary
{
	private Set<WordMeaning> meanings = new HashSet<WordMeaning>();
	
	public Set<WordMeaning> getMeanings() {
		return meanings;
	}
	public void setMeanings(Set<WordMeaning> meanings) {
		this.meanings = meanings;
	}
	public Word(){}
	public Word(Integer id)
	{
		this.id = id;
	}
	@Override
	public String toString() {
		return "Word [id=" + id + ", val=" + val + ", unit=" + unit + ", book="
				+ book + "]";
	}
	public String getMeaningCnStr()
	{
		String result = "";
		for (WordMeaning m : meanings)
		{
			result += m.getMeaningType() + ' ' + m.getMeaningCn() + '\n';
		}
		return result;
	}
}
